<?php

namespace App\Admin\Override\Action;

use Dcat\Admin\Grid\RowAction;

class Edit extends RowAction
{
    /**
     * @return array|null|string
     */
    public function title()
    {
        if ($this->title) {
            return $this->title;
        }
        $title = __('admin.edit');
        if(is_string($this->parent->getEditName()) && $this->parent->getEditName()){
            $title = $this->parent->getEditName();
        }
        return '<i class="feather icon-edit-1"></i> '.$title.'&nbsp;&nbsp;';
    }

    /**
     * @return string
     */
    public function href()
    {
        return $this->parent->getEditUrl($this->getKey());
    }
}
